package com.atguigu.gmall.list.api;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.list.service.SkuSearchService;
import com.atguigu.gmall.model.list.SearchParam;
import com.atguigu.gmall.model.list.SearchResponseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 钟涛
 * @version 1.0
 * @description: TODO
 * @date 2021/12/18 16:56
 */
@RequestMapping("/api/es/search")
@RestController
public class SearchController {
    @Autowired
    private SkuSearchService skuSearchService;
    @PostMapping("/sku")
    public SearchResponseVo search(@RequestBody SearchParam param){
        SearchResponseVo search = skuSearchService.search(param);
        return search;
    }
}
